import { lazy } from "react";
import {
    AppOutline,
    AppstoreOutline,
    MessageOutline,
    UserOutline
} from 'antd-mobile-icons'

const Index = lazy(() => import('../pages/index'))
const Class = lazy(() => import('../pages/index'))
const Message = lazy(() => import('../pages/index'))
const User = lazy(() => import('../pages/index'))
const Home = lazy(() => import('../pages/home'))
const Detail = lazy(() => import('../pages/detail'))
const Order = lazy(() => import('../pages/order'))
const Addpreson = lazy(() => import('../pages/addpreson'))
const OrderConfig = lazy(() => import('../pages/orderConfig'))
const Success = lazy(() => import('../pages/success'))
const Error = lazy(() => import('../pages/404'))

export const homeRouters = [
    {
        path: '/',
        element: <Index></Index>,
        title: '首页',
        icon: <AppOutline />
    },
    {
        path: '/class',
        element: <Class></Class>,
        title: '分类',
        icon: <AppstoreOutline />
    },
    {
        path: '/message',
        element: <Message></Message>,
        title: '消息',
        icon: <MessageOutline />
    },
    {
        path: '/user',
        element: <User></User>,
        title: '个人中心',
        icon: <UserOutline />
    },
]

export const routers = [
    {
        path: '/',
        element: <Home></Home>,
        children: homeRouters
    },
    {
        path:'/detail/:id',
        element:<Detail></Detail>
    },
    {
        path:'/order',
        element:<Order></Order>
    },
    {
        path:'/addpreson',
        element:<Addpreson></Addpreson>
    },
    {
        path:'/orderConfig',
        element:<OrderConfig></OrderConfig>
    },
    {
        path:'/success',
        element:<Success></Success>
    },
    {
        path: '*',
        element: <Error></Error>
    }
]